// 1.导入vue-router包
import VueRouter from 'vue-router'

// 导入相应的路由组件
import Home from '../components/tabbar/HomeContainer.vue'
import Member from '../components/tabbar/MemberContainer.vue'
import Search from '../components/tabbar/SearchContainer.vue'
import ShopCar from '../components/tabbar/ShopCarContainer.vue'
import Newlist from '../components/news/Newslist.vue'
import NewInfo from '../components/news/NewsInfo.vue'
import Photolist from '../components/photos/Photolist.vue'
import Photoinfo from '../components/photos/Photoinfo.vue'
import Goodslist from '../components/goods/Goodslist.vue'
import Goodsinfo from '../components/goods/Goodsinfo.vue'
import Goodscontent from '../components/goods/Goodscontent.vue'
import Goodscomment from '../components/goods/Goodscomment.vue'
// 3.创建路由对象
var router=new VueRouter({
	routes:[
		{path:'/',redirect:'/home'},
		{path:'/home',component:Home},
		{path:'/member',component:Member},
		{path:'/search',component:Search},
		{path:'/shopcar',component:ShopCar},
		{path:'/home/newslist',component:Newlist},
		// id是一个参数，可以为任何数
		{path:'/home/newsinfo/:id',component:NewInfo},
		{path:'/home/photolist',component:Photolist},
		{path:'/home/photo/:id',component:Photoinfo},
		{path:'/home/goodslist',component:Goodslist},
		{path:'/home/good/:id',component:Goodsinfo},
		{path:'/home/goodcontent/:id',component:Goodscontent},
		{path:'/home/gocomment/:id',component:Goodscomment},
	],
	// 覆盖默认的路由高亮的类（点击进入某路由时自动触发），默认的类是router-link-active
	//设置为mui-active是为了点击进入该路由时能够使用mui-active的样式，mui-active这个类的样式在mui中设置好了的
	linkActiveClass:"mui-active"
})

// 由于把路由从main.js中抽离出来了，所以需要把路由对象暴露出去
export default router
